<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

</body>

<style type="text/css">
	#timers{
		width: 400px;height: 50px;border: 1px solid #000;color: red;font-size: 25px;text-align: center;
	}
</style>

</html>


<script type="text/javascript">
	function showtime(){
		var d = new Date();
		var year = d.getFullYear();
		var month = d.getMonth()+1;//0-11
		var date = d.getDate();
		var week = d.getDay();//0-6 星期天获取的值为0
		var hour = d.getHours();
		var minute = d.getMinutes();
		var second = d.getSeconds();

		var timerstr = "今天是"+year+"年"+month+"月"+date+"日"+" 星期"+changeweek(week)+hour+"时"+minute+"分"+second+"秒";
		return timerstr

	}

	function changeweek(week) {
		var weekarr = ["日","一","二","三","四","五","六"];
		return weekarr[week]
	}

	setInterval(function(){
		var timers = document.getElementById("timers");
		timers.innerHTML = showtime()
	},1000)

</script>
